/**
 * Copyright (c) 2013-2014 Quentin Smetz <qsmetz@gmail.com>, Sebastien
 * Jodogne <s.jodogne@gmail.com>
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 **/


//!
//! \file VolumeSubInterface.cpp
//! \brief The VolumeSubInterface.cpp file contains the definition of non-inline
//!        methods of the VolumeSubInterface class.
//!
//! \author Quentin Smetz
//!

#include "VolumeSubInterface.h"
using namespace std;
using namespace customwidget;

// Constructor
VolumeSubInterface::VolumeSubInterface(SeriesData* series) : SubInterface()
{
    setViewer(new SeriesVolumeViewer(series));
    initInterface();
}

// Constructor II
VolumeSubInterface::VolumeSubInterface(MergedSeriesVolumeViewer* viewer) : SubInterface()
{
    setViewer(viewer);
    initInterface();
}

// Destructor
VolumeSubInterface::~VolumeSubInterface()
{}

// The 'initInterface' method
void VolumeSubInterface::initInterface()
{
    // Construct the interface
    QHBoxLayout* hLayout = new QHBoxLayout();

    m_mipButton = new PushButton("MIP");
    m_mipButton->setCheckable(true);
    hLayout->addWidget(m_mipButton);

    m_gridLayout->addLayout(hLayout, 2, 1);

    // Event connections
    connect(m_mipButton, SIGNAL(clicked(bool)), m_viewer, SLOT(enableMip(bool)));
}
